<template>
  <!--视频列表-->
  <div class="low-half">
    <div class="label-content">
      <div class="row">
        <div class="video" v-for="item in recommendList" :key="item.id" >
          <a target="_blank" :href="`https://dance365.com/detail/video?momentId=${item.id}&source=recommend`">
            <img class="video-photo" :src="item.cover[0]" alt="">
          </a>
          <div class="pos_video">
            <img src="@/assets/images/video.png" alt="">
          </div>
          <div class="intro">
            <span class="maker">作品</span>
            <span class="desc">{{item.title}}</span>
          </div>
          <div class="now">
            <div class="con_text">
              <div class="price" v-show="bol"><span>￥{{item.initExposureNum}}</span></div>
              <div class="browse">
                <span>{{item.statisticsBackup.viewCount}}人浏览</span>
              </div>
              <div class="vip" v-show="bol">会员免费</div>
            </div>
            <div class="asterisk">
              <span><el-icon size="12px"><Pointer/></el-icon>{{(item.num+'').slice(0,5)}}</span>
              <span><el-icon size="12px"><ChatDotRound/></el-icon>{{item.initExposureNum}}</span>
              <span><el-icon size="12px"><StarFilled/></el-icon>{{item.algorithmSortValue}}</span>
            </div>
            <div class="photo">
              <div><img :src="item.creatorBackup.avatar" alt="用户头像"><span style="padding-left: 5px">{{item.creatorBackup.name}}</span></div>
              <div class="nameData"><span>{{ moment(item.updateTime).format('MM-DD') }}</span></div>
            </div>
          </div>
          <div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default {
  name: 'videoList',
}
</script>
<script lang="ts" setup>
import {computed} from "vue";
import moment from "moment";

const props = defineProps<{recommendList:any,bol:any}>()
const createTime = computed(()=>{
  return moment(props.recommendList.createTime).format('MM-DD')
})
</script>

<style scoped lang="scss">
//左边标签页样式
.low-half {
  background-color: rgb(245, 247, 249);
  width: 100%;
  min-height: 720px;

  // 标签下部分的盒子
  .label-content {
    width: 1270px;
    min-height: 500px;
    margin: 20px auto;

    // 视频列表
    .row {
      width: 100%;
      margin-left: 10px;
      margin-top: 40px;
      display: flex;
      flex-wrap: wrap;

      .video {
        position: relative;
        width: 20%;
        height: 226px;
        margin-top: 30px;
        margin-bottom: 100px;
        // 视频的图片样式
        .video-photo {
          border-radius: 10px;
          width: 227px;
          height: 200px;
        }
        .pos_video{
          position: absolute;
          left: 22px;
          bottom: 30px;
          cursor: pointer;
          img{
            width: 30px;
            height: 30px;
          }
        }
        // 作品按钮键
        .intro {
          font-size: 12px;
          line-height:20px;
          height: 20px;
          display: flex;
          flex-wrap: wrap;
          justify-content: flex-start;
          .maker{
            border: 1px solid green;
            padding: 0 5px;
            margin-right: 3px;
            flex: 1;
          }
          .desc{
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex: 6;
          }
          padding: 10px 0 0 16px;
        }
      }
      .now{
        padding:13px 16px;
        .con_text{
          padding:0 0 20px 0;
          position: relative;
          display: flex;
          justify-content: space-between;
          align-items: center;
          .price{
            span{
              color: #f93684;
            }
          }
          // 视频浏览人数
          .browse {
            //padding-top: 10px;
            color: #b1b5c1;
            font-size: 12px;
            display: flex;
          }
          .vip{
            position: absolute;
            bottom: 0;
            left: 0;
            background-color: #f93684;
            font-size: 12px;
            color: white;
            padding:2px 3px;
            border-radius: 5px;
          }
        }
        // 点赞数量和收藏
        .asterisk {
          display: flex;
          width: 200px;
          font-size: 14px;
          color: #b1b5c1;
          padding-bottom: 6px;
          border-bottom: #b1b5c1 solid 1px;

          span {
            align-items: center;
            margin-right: 19px;
          }
        }
      }
    }



    //  用户头像样式
    .photo {
      padding: 6px 0;
      width: 200px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;

      // 头像变圆形
      img {
        width: 20px;
        height: 20px;
        border-radius: 50%;
      }
      // 日期字体颜色
      .nameData {
        color: #b1b5c1;
      }
    }
  }
  .my-header{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

}
</style>
